<h1>My Clients</h1>
<?=str_replace(array('&lt;','&gt;'),array('<','>'),$this->cms->fetchPageContent('account_aff_clients'));?>

	<p>
<table class="greentable">
    <thead>
    <tr>
        <th>Name</th>
		<th>Type</th>
		<th>Platform</th>
		<th>Account</th>
		<th>E-mail</th>
        <th>Registered</th>
    </tr>
    </thead>
    <tbody>
	<?php foreach($refs as $ref){ ?>
    <tr>
        <td><?php echo $ref->firstname. ($ref->firstname&&$ref->lastname?' ':'') . $ref->lastname?></td>
        <td><?php echo (strtolower($ref->type)=='real'?'Live':ucfirst($ref->type)); ?></td>
		<td><?php echo (in_array($ref->mt4_group,array('GM-AUTO','GM-AUTO2','GM-AUTO3'))?'Mirror':'MT4'); ?></td>
		<td><?php echo (in_array($ref->mt4_group,array('GM-AUTO','GM-AUTO2','GM-AUTO3'))?$ref->mirror_login_id:$ref->mt4_uid); ?></td>
		<td><?php echo $ref->email ? $ref->email : 'N/A'; ?></td>
		<td><?php echo $ref->added ? date("d-M-y",$ref->added) : 'N/A'; ?></td>
    </tr>
    <?php } ?>
	<?php
			if($refs->result_count()==0)
			{
	?>
	<tr><td colspan="5">No records found.</td></tr>
	<?php
			}
	?>
    </tbody>
</table>